package com.dong.policy.controller;

import com.dong.common.Result;
import com.dong.policy.entity.mysql.sakila.Actor;
import com.dong.policy.service.sakila.ActorService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/actor")
public class ActorController {
    private final ActorService actorService ;

    public ActorController(ActorService actorService) {
        this.actorService = actorService;
    }
    @GetMapping("/test/{lastName}")
    public Result testTransaction(@PathVariable("lastName") String lastName){
        actorService.update(new Actor("1","zhao",lastName));
        actorService.add(new Actor("TT",lastName));
        return Result.ok();
    }
}
